package com.nineclock.approve.resolver;

import cn.hutool.json.JSONObject;
import org.activiti.bpmn.model.Process;
import org.activiti.bpmn.model.StartEvent;

// 开始节点处理器
public class StartNodeResolver extends ProcessNodeResolver{

    @Override
    public void addFlowNodeToActiviti(Process process, JSONObject currNode, JSONObject nextNode) {
        // 创建开始节点
        StartEvent startEvent = new StartEvent();
        startEvent.setId(getNodeId(currNode));
        startEvent.setName(currNode.getStr("name"));
        process.addFlowElement(startEvent);
        // 绘制连线指向下一个节点
        newSequenceFlow(process, currNode, nextNode);
    }
}
